Dictionary in Bash

Example

declare -A animals
animals=( ["moo"]="cow" )
echo "${animals["moo"]}"
for sound in "${!animals[@]}"; do echo "$sound - ${animals["$sound"]}"; done

Reference

Homepage
Comments

Hide Comments